﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReversePolishNotation;

namespace RPNTest
{
    class Program
    {
        static void Main(string[] args)
        {
            
            RPN rpn = new RPN();

            do
            {
                try
                {
                    Console.Write("Type infix expression [ctrl+c to brake]: ");
                    string infix = Console.ReadLine();
                    Console.WriteLine("Result: {0}", rpn.Eval(infix).Content);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception!");
                    Console.WriteLine(ex.Message);
                }                

            } while (true);
        }
    }
}
